/**
 * 
 */
package com.bitBusy.manageyourriches.utilityClasses.display;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;

import com.bitBusy.manageyourriches.R;

/**
 * @author SumaHarsha
 *
 */
public class LocalNotificationManager {
	
	private static final String ALARMTITLE = "Manage your riche$";
	



	/**
	 * @param bademailnotification2
	 */
	public static void showNotification(Context the_context, String the_string) {
		if (the_context != null)
		{
			 NotificationManager myNotificationManager = 
					 (NotificationManager) the_context.getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
		       Intent intent = new Intent();
		       	intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP| Intent.FLAG_ACTIVITY_CLEAR_TOP);
		       PendingIntent pendingNotificationIntent = PendingIntent.getActivity( the_context.getApplicationContext(),0, intent,PendingIntent.FLAG_UPDATE_CURRENT);
	
		       Notification notification = new Notification.Builder(the_context.getApplicationContext()).setSmallIcon(R.drawable.title).setContentText(the_string).setContentTitle(ALARMTITLE).setContentIntent(pendingNotificationIntent)
		    		   .setLights(Color.YELLOW, 500, 500).setAutoCancel(true).build();
		       	notification.defaults = 0;
		 
		     notification.flags |= Notification.FLAG_AUTO_CANCEL;
		       
		       myNotificationManager.notify(0, notification);
			
		}
	}

}
